cmake_minimum_required(VERSION 2.8)

project(SandboxGame)

set(GLEW_DIR C:/chenchang/app/glew-1.13.0_src/glew-1.13.0)
set(QT_DIR C:/Qt/4.8.6)

include_directories(${GLEW_DIR}/include)
include_directories(${QT_DIR}/include)

link_libraries(${GLEW_DIR}/build/cmake/bld/lib/$<$<CONFIG:Debug>:Debug>$<$<NOT:$<CONFIG:Debug>>:Release>/glew32$<$<CONFIG:Debug>:d>.lib)
link_libraries(${QT_DIR}/lib/QtCore$<$<CONFIG:Debug>:d>4.lib)
link_libraries(${QT_DIR}/lib/QtGui$<$<CONFIG:Debug>:d>4.lib)
link_libraries(${QT_DIR}/lib/QtOpenGL$<$<CONFIG:Debug>:d>4.lib)
link_libraries(opengl32.lib)

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/MyGlWindow_moc.cpp
    COMMAND c:/qt/4.8.6/bin/moc.exe ${PROJECT_SOURCE_DIR}/MyGlWindow.h > ${PROJECT_BINARY_DIR}/MyGlWindow_moc.cpp
    MAIN_DEPENDENCY MyGlWindow.h
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

set(FILES main.cpp
    MyGlWindow.h
    MyGlWindow.cpp
    ${PROJECT_BINARY_DIR}/MyGlWindow_moc.cpp)
add_executable(SandboxGame ${FILES})
